// 服务器入口文件
// 1.创建KOA实例对象
const Koa = require('koa')
const app = new Koa()
// 2.绑定中间件
// 绑定第一层中间件
const resDurationMiddleWare = require('./middleware/koa_response_duration')
app.use(resDurationMiddleWare)
// 绑定第二层中间件
const respHeaderMiddleWare = require('./middleware/koa_response_header')
app.use(respHeaderMiddleWare)
// 绑定第三层中间件
const respDataMiddleWare = require('./middleware/koa_response_data')
app.use(respDataMiddleWare)
// 3.绑定端口号 8888
app.listen(8888)

const webSocketService = require('./service/web_socket_service')
webSocketService.listen()
